(function(win, doc){
	var defaultStyle = {
		color: "red",
		background: "blue",
		border: "2px solid #000",
		fontSize: "30px",
		textAlign: "center",
		width: "200px",
		borderRadius: "5px",
		height: "20px"
	};
	
	function setStyle(options){
		var _this = this;
		console.log(options);
		if(!options){
			throw new Error("请传入配置参数！");
	    }
		_this = Object.assign(_this,defaultStyle,options);
		_this.container = doc.querySelector(_this.container) || doc.querySelectorAll();
		_this._changeStyle();
	}
	
	setStyle.prototype = {
		_changeStyle: function(){
			var _this = this;
			for(var pro in _this) {
				if(pro == "container") {
					continue;
				}
				if(pro == "text" && typeof _this[pro] == "string") {
					_this.container.innerText = _this[pro]();
					continue;
				}
				_this.container.style[pro] = _this[pro];
			}
		}
	}
	win.setStyle = setStyle;
})(window,document)
